import ogr,sys
name = sys.argv[1]
idname= sys.argv[2]

ds=ogr.Open( name , update = 1)
if ds is None:
    print "Open failed\n"
    sys.exit(1)
lyr = ds.GetLayerByName(name.replace(".shp",''))


for i in lyr:
    i.SetField("DESA_ID", idname)
    lyr.SetFeature(i)
